package com.distributed.kv.dto;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * KV请求对象
 */
public class KvRequest {
    
    @NotBlank(message = "Key不能为空")
    @Size(max = 255, message = "Key长度不能超过255字符")
    private String key;
    
    @Size(max = 4096, message = "Value长度不能超过4096字符")
    private String value;
    
    private Integer ttl; // TTL in seconds
    
    public KvRequest() {}
    
    public KvRequest(String key) {
        this.key = key;
    }
    
    public KvRequest(String key, String value) {
        this.key = key;
        this.value = value;
    }
    
    public String getKey() { return key; }
    public void setKey(String key) { this.key = key; }
    
    public String getValue() { return value; }
    public void setValue(String value) { this.value = value; }
    
    public Integer getTtl() { return ttl; }
    public void setTtl(Integer ttl) { this.ttl = ttl; }
}

